package homeword;
//调用String里面的charAt进行遍历字符串
import java.util.Scanner;
public class printfString {
    public static void main(String[] args) {
        String string;
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入一个字符串");
        String string1 = scanner.next();
        for (int i = 0; i < string1.length(); i++) {
            //i为字符串的索引
            char c=string1.charAt(i);
            System.out.print(c);
        }
    }
}
